home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume23 / trn / part02 < prev    next >
Encoding:
Text File  |  1991-08-22  |  64.6 KB  |  2,116 lines

  1. This is a new archive version of TRN at patchlevel 3.
  2. The original posting took up Volume23, issues 60 to 73, with
  3. various problems.  These files replace those issues.
  4.  
  5. #! /bin/sh
  6. # This is a shell archive.  Remove anything before this line, then feed it
  7. # into a shell via "sh file" or similar.  To overwrite existing files,
  8. # type "sh file -c".
  9. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  10. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  11. # Contents:  artio.h bits.c trn.1.2
  12. # Wrapped by rsalz@litchi.bbn.com on Fri Aug 23 16:38:50 1991
  13. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  14. echo If this archive is complete, you will see the following message:
  15. echo '          "shar: End of archive 2 (of 14)."'
  16. if test -f 'artio.h' -a "${1}" != "-c" ; then 
  17.   echo shar: Will not clobber existing file \"'artio.h'\"
  18. else
  19.   echo shar: Extracting \"'artio.h'\" \(1464 characters\)
  20.   sed "s/^X//" >'artio.h' <<'END_OF_FILE'
  21. X/* $Header: artio.h,v 4.3.3.2 91/01/16 02:20:49 davison Trn $
  22. X *
  23. X * $Log:    artio.h,v $
  24. X * Revision 4.3.3.2  91/01/16  02:20:49  davison
  25. X * Added optional prototyping.
  26. X * 
  27. X * Revision 4.3.3.1  90/07/21  20:12:10  davison
  28. X * Initial Trn Release
  29. X * 
  30. X * Revision 4.3.2.2  89/11/27  01:27:53  sob
  31. X * Altered NNTP code per ideas suggested by Bela Lubkin
  32. X * <filbo@gorn.santa-cruz.ca.us>
  33. X * 
  34. X * Revision 4.3.2.1  89/11/26  22:41:24  sob
  35. X * Added RRN support
  36. X * 
  37. X * Revision 4.3  85/05/01  11:35:43  lwall
  38. X * Baseline for release with 4.3bsd.
  39. X * 
  40. X */
  41. X
  42. XEXT ART_POS artpos INIT(0);    /* byte position in article file */
  43. X
  44. XEXT ART_LINE artline INIT(0);        /* current line number in article file */
  45. XEXT FILE *artfp INIT(Nullfp);        /* current article file pointer */
  46. XEXT ART_NUM openart INIT(0);        /* what is the currently open article number? */
  47. X#ifdef LINKART
  48. X    EXT char *linkartname INIT(nullstr);/* real name of article for Eunice */
  49. X#endif
  50. X#ifdef SERVER
  51. XEXT ART_PART openpart INIT(0);    /* how much of that article do we have? */
  52. XFILE    *nntpopen ANSI((ART_NUM,ART_PART));
  53. X                /* get an article unless already retrieved */
  54. Xvoid    nntpclose ANSI((void));
  55. X/* MUST be in increasing order of completeness! */
  56. X#define GET_STATUS    1        /* test for existence only */
  57. X#define GET_HEADER    2        /* if only header items are desired */
  58. X#define GET_ARTICLE    3        /* retreive full article  */
  59. X#endif
  60. X
  61. Xvoid    artio_init ANSI((void));
  62. XFILE    *artopen ANSI((ART_NUM));  /* open an article unless already opened */
  63. END_OF_FILE
  64.   if test 1464 -ne `wc -c <'artio.h'`; then
  65.     echo shar: \"'artio.h'\" unpacked with wrong size!
  66.   fi
  67.   # end of 'artio.h'
  68. fi
  69. if test -f 'bits.c' -a "${1}" != "-c" ; then 
  70.   echo shar: Will not clobber existing file \"'bits.c'\"
  71. else
  72.   echo shar: Extracting \"'bits.c'\" \(17700 characters\)
  73.   sed "s/^X//" >'bits.c' <<'END_OF_FILE'
  74. X/* $Header: bits.c,v 4.3.3.2 91/01/16 02:29:48 davison Trn $
  75. X *
  76. X * $Log:    bits.c,v $
  77. X * Revision 4.3.3.2  91/01/16  02:29:48  davison
  78. X * Integrated rn patches 48-54.
  79. X * 
  80. X * Revision 4.3.3.1  90/06/20  22:36:24  davison
  81. X * Initial Trn Release
  82. X * 
  83. X * Revision 4.3.2.5  90/11/22  13:47:16  sob
  84. X * Altered #endifs to make System V compiliers happy.
  85. X * 
  86. X * Revision 4.3.2.4  90/10/06  11:55:33  sob
  87. X * Added fix for DBM support.
  88. X * 
  89. X * Revision 4.3.2.3  89/11/28  01:52:02  sob
  90. X * Removed some lint.
  91. X * 
  92. X * Revision 4.3.2.2  89/11/27  01:30:04  sob
  93. X * Altered NNTP code per ideas suggested by Bela Lubkin
  94. X * <filbo@gorn.santa-cruz.ca.us>
  95. X * 
  96. X * Revision 4.3.1.4  86/10/31  15:23:53  lwall
  97. X * Separated firstart into two variables so KILL on new articles won't
  98. X * accidentally mark articles read.
  99. X * 
  100. X * Revision 4.3.1.3  86/09/09  16:01:43  lwall
  101. X * Fixed 'n more articles' bug.
  102. X * 
  103. X * Revision 4.3.1.2  86/07/24  14:40:23  lwall
  104. X * Gets host name from path instead of relay-version for news 2.10.3.
  105. X *
  106. X * Revision 4.3.1.1  85/05/10  11:31:41  lwall
  107. X * Branch for patches.
  108. X *
  109. X * Revision 4.3  85/05/01  11:36:15  lwall
  110. X * Baseline for release with 4.3bsd.
  111. X * 
  112. X */
  113. X
  114. X#include "EXTERN.h"
  115. X#include "common.h"
  116. X#include "rcstuff.h"
  117. X#include "head.h"
  118. X#include "util.h"
  119. X#include "final.h"
  120. X#include "rn.h"
  121. X#include "cheat.h"
  122. X#include "ng.h"
  123. X#include "artio.h"
  124. X#include "intrp.h"
  125. X#include "ngdata.h"
  126. X#include "rcln.h"
  127. X#include "kfile.h"
  128. X#ifdef USETHREADS
  129. X#include "rthreads.h"
  130. X#endif
  131. X#include "INTERN.h"
  132. X#include "bits.h"
  133. X
  134. X#ifdef DBM
  135. X#    ifdef NULL
  136. X#    undef NULL
  137. X#    endif
  138. X#    include <dbm.h>
  139. X#endif
  140. XMEM_SIZE ctlsize;            /* size of bitmap in bytes */
  141. X
  142. Xvoid
  143. Xbits_init()
  144. X{
  145. X#ifdef DELAYMARK
  146. X    dmname = savestr(filexp(RNDELNAME));
  147. X#else
  148. X    ;
  149. X#endif
  150. X}
  151. X
  152. X/* checkpoint the .newsrc */
  153. X
  154. Xvoid
  155. Xcheckpoint_rc()
  156. X{
  157. X#ifdef DEBUGGING
  158. X    if (debug & DEB_CHECKPOINTING) {
  159. X    fputs("(ckpt)",stdout);
  160. X    fflush(stdout);
  161. X    }
  162. X#endif
  163. X    if (doing_ng)
  164. X    restore_ng();            /* do not restore M articles */
  165. X    if (rc_changed)
  166. X    write_rc();
  167. X#ifdef DEBUGGING
  168. X    if (debug & DEB_CHECKPOINTING) {
  169. X    fputs("(done)",stdout);
  170. X    fflush(stdout);
  171. X    }
  172. X#endif
  173. X}
  174. X
  175. X/* reconstruct the .newsrc line in a human readable form */
  176. X
  177. Xvoid
  178. Xrestore_ng()
  179. X{
  180. X    register char *s, *mybuf = buf;
  181. X    register ART_NUM i;
  182. X    ART_NUM count=0;
  183. X    int safelen = LBUFLEN - 16;
  184. X
  185. X    strcpy(buf,rcline[ng]);        /* start with the newsgroup name */
  186. X    s = buf + rcnums[ng] - 1;        /* use s for buffer pointer */
  187. X    *s++ = rcchar[ng];            /* put the requisite : or !*/
  188. X    *s++ = ' ';                /* put the not-so-requisite space */
  189. X    for (i=1; i<=lastart; i++) {    /* for each article in newsgroup */
  190. X    if (s-mybuf > safelen) {    /* running out of room? */
  191. X        safelen *= 2;
  192. X        if (mybuf == buf) {        /* currently static? */
  193. X        *s = '\0';
  194. X        mybuf = safemalloc((MEM_SIZE)safelen + 16);
  195. X        strcpy(mybuf,buf);    /* so we must copy it */
  196. X        s = mybuf + (s-buf);
  197. X                    /* fix the pointer, too */
  198. X        }
  199. X        else {            /* just grow in place, if possible */
  200. X        char *newbuf;
  201. X
  202. X        newbuf = saferealloc(mybuf,(MEM_SIZE)safelen + 16);
  203. X        s = newbuf + (s-mybuf);
  204. X        mybuf = newbuf;
  205. X        }
  206. X    }
  207. X    if (!was_read(i))        /* still unread? */
  208. X        count++;            /* then count it */
  209. X    else {                /* article was read */
  210. X        ART_NUM oldi;
  211. X
  212. X        sprintf(s,"%ld",(long)i);    /* put out the min of the range */
  213. X        s += strlen(s);        /* keeping house */
  214. X        oldi = i;            /* remember this spot */
  215. X        do i++; while (i <= lastart && was_read(i));
  216. X                    /* find 1st unread article or end */
  217. X        i--;            /* backup to last read article */
  218. X        if (i > oldi) {        /* range of more than 1? */
  219. X        sprintf(s,"-%ld,",(long)i);
  220. X                    /* then it out as a range */
  221. X        s += strlen(s);        /* and housekeep */
  222. X        }
  223. X        else
  224. X        *s++ = ',';        /* otherwise, just a comma will do */
  225. X    }
  226. X    }
  227. X    if (*(s-1) == ',')            /* is there a final ','? */
  228. X    s--;                /* take it back */
  229. X    *s++ = '\0';            /* and terminate string */
  230. X#ifdef DEBUGGING
  231. X    if (debug & DEB_NEWSRC_LINE && !panic) {
  232. X    printf("%s: %s\n",rcline[ng],rcline[ng]+rcnums[ng]) FLUSH;
  233. X    printf("%s\n",mybuf) FLUSH;
  234. X    }
  235. X#endif
  236. X    free(rcline[ng]);            /* return old rc line */
  237. X    if (mybuf == buf) {
  238. X    rcline[ng] = safemalloc((MEM_SIZE)(s-buf)+1);
  239. X                    /* grab a new rc line */
  240. X    strcpy(rcline[ng], buf);    /* and load it */
  241. X    }
  242. X    else {
  243. X    mybuf = saferealloc(mybuf,(MEM_SIZE)(s-mybuf)+1);
  244. X                    /* be nice to the heap */
  245. X    rcline[ng] = mybuf;
  246. X    }
  247. X    *(rcline[ng] + rcnums[ng] - 1) = '\0';
  248. X    if (rcchar[ng] == NEGCHAR) {    /* did they unsubscribe? */
  249. X    printf(unsubto,ngname) FLUSH;
  250. X    toread[ng] = TR_UNSUB;        /* make line invisible */
  251. X    }
  252. X    else
  253. X    /*NOSTRICT*/
  254. X    toread[ng] = (ART_UNREAD)count;        /* remember how many unread there are */
  255. X}
  256. X
  257. X/* mark an article unread, keeping track of toread[] */
  258. X
  259. Xvoid
  260. Xonemore(artnum)
  261. XART_NUM artnum;
  262. X{
  263. X#ifdef DEBUGGING
  264. X    if (debug && artnum < firstbit) {
  265. X    printf("onemore: %d < %d\n",artnum,firstbit) FLUSH;
  266. X    return;
  267. X    }
  268. X#endif
  269. X    if (ctl_read(artnum)) {
  270. X    ctl_clear(artnum);
  271. X    ++toread[ng];
  272. X    }
  273. X}
  274. X
  275. X/* mark an article read, keeping track of toread[] */
  276. X
  277. Xvoid
  278. Xoneless(artnum)
  279. XART_NUM artnum;
  280. X{
  281. X#ifdef DEBUGGING
  282. X    if (debug && artnum < firstbit) {
  283. X    printf("oneless: %d < %d\n",artnum,firstbit) FLUSH;
  284. X    return;
  285. X    }
  286. X#endif
  287. X    if (!ctl_read(artnum)) {
  288. X    ctl_set(artnum);
  289. X    if (toread[ng] > TR_NONE)
  290. X        --toread[ng];
  291. X    }
  292. X}
  293. X
  294. X/* mark an article as unread, making sure that firstbit is properly handled */
  295. X/* cross-references are left as read in the other newsgroups */
  296. X
  297. Xvoid
  298. Xunmark_as_read()
  299. X{
  300. X    check_first(art);
  301. X#ifdef USETHREADS
  302. X    /* Keep selected_count accurate */
  303. X    if (ctl_read(art)) {
  304. X    find_article(art);
  305. X    if (p_art) {
  306. X        if (selected_roots[p_art->root]) {
  307. X        selected_count++;
  308. X        }
  309. X        root_article_cnts[p_art->root] = 1;
  310. X    } else
  311. X        unthreaded++;
  312. X    }
  313. X    scan_all_roots = FALSE;
  314. X#endif
  315. X    onemore(art);
  316. X#ifdef MCHASE
  317. X    if (!parse_maybe(art))
  318. X    chase_xrefs(art,FALSE);
  319. X#endif
  320. X}
  321. X
  322. X#ifdef USETHREADS
  323. X/* mark an article as read in this newsgroup only */
  324. X
  325. Xvoid
  326. Xset_read(artnum,sel)
  327. XART_NUM artnum;
  328. Xint sel;
  329. X{
  330. X    if (!ctl_read(artnum)) {
  331. X    oneless(artnum);
  332. X    if( p_art->subject != -1 )
  333. X        selected_count -= sel;
  334. X    }
  335. X}
  336. X
  337. X/* mark an article as unread in this newsgroup only */
  338. X
  339. Xvoid
  340. Xset_unread(artnum,sel)
  341. XART_NUM artnum;
  342. Xint sel;
  343. X{
  344. X    if (artnum >= absfirst) {
  345. X    check_first(artnum);
  346. X    if (ctl_read(artnum)) {
  347. X        onemore(artnum);
  348. X        selected_count += sel;
  349. X        root_article_cnts[p_art->root] = 1;
  350. X        scan_all_roots = FALSE;
  351. X    }
  352. X    }
  353. X}
  354. X#endif
  355. X
  356. X#ifdef DELAYMARK
  357. X/* temporarily mark article as read.  When newsgroup is exited, articles */
  358. X/* will be marked as unread.  Called via M command */
  359. X
  360. Xvoid
  361. Xdelay_unmark(artnum)
  362. XART_NUM artnum;
  363. X{
  364. X    if (dmfp == Nullfp) {
  365. X    dmfp = fopen(dmname,"w+");
  366. X    if (dmfp == Nullfp) {
  367. X        printf(cantcreate,dmname) FLUSH;
  368. X        sig_catcher(0);
  369. X    }
  370. X    }
  371. X#ifdef USETHREADS
  372. X    /* Keep selected_count accurate */
  373. X    if (!ctl_read(artnum)) {
  374. X    find_article(artnum);
  375. X    if (p_art) {
  376. X        if (selected_roots[p_art->root])
  377. X        selected_count--;
  378. X    } else
  379. X        unthreaded--;
  380. X    }
  381. X#endif
  382. X    oneless(artnum);            /* set the correct bit */
  383. X    dmcount++;
  384. X    fprintf(dmfp,"%ld\n",(long)artnum);
  385. X}
  386. X#endif
  387. X
  388. X/* mark article as read.  If article is cross referenced to other */
  389. X/* newsgroups, mark them read there also. */
  390. X
  391. Xvoid
  392. Xmark_as_read()
  393. X{
  394. X#ifdef USETHREADS
  395. X    /* Keep selected_count accurate */
  396. X    if (!ctl_read(art)) {
  397. X    find_article(art);
  398. X    if (p_art) {
  399. X        if (selected_roots[p_art->root])
  400. X        selected_count--;
  401. X    } else
  402. X        unthreaded--;
  403. X    }
  404. X#endif
  405. X    oneless(art);            /* set the correct bit */
  406. X    checkcount++;            /* get more worried about crashes */
  407. X    chase_xrefs(art,TRUE);
  408. X}
  409. X
  410. X/* make sure we have bits set correctly down to firstbit */
  411. X
  412. Xvoid
  413. Xcheck_first(min)
  414. XART_NUM min;
  415. X{
  416. X    register ART_NUM i = firstbit;
  417. X
  418. X    if (min < absfirst)
  419. X    min = absfirst;
  420. X    if (min < i) {
  421. X    for (i--; i>=min; i--)
  422. X        ctl_set(i);        /* mark as read */
  423. X    firstart = firstbit = min;
  424. X    }
  425. X}
  426. X
  427. X/* bring back articles marked with M */
  428. X
  429. X#ifdef DELAYMARK
  430. Xvoid
  431. Xyankback()
  432. X{
  433. X    if (dmfp) {            /* delayed unmarks pending? */
  434. X#ifdef VERBOSE
  435. X    printf("\nReturning %ld Marked article%s...\n",(long)dmcount,
  436. X        dmcount == 1 ? nullstr : "s") FLUSH;
  437. X#endif
  438. X    rewind(dmfp);
  439. X    while (fgets(buf,sizeof buf,dmfp) != Nullch) {
  440. X        art = (ART_NUM)atol(buf);
  441. X        unmark_as_read();
  442. X    }
  443. X    fclose(dmfp);
  444. X    dmfp = Nullfp;
  445. X    UNLINK(dmname);        /* and be tidy */
  446. X    }
  447. X    dmcount = 0;
  448. X}
  449. X#endif
  450. X    
  451. X/* run down xref list and mark as read or unread */
  452. X
  453. Xint
  454. Xchase_xrefs(artnum,markread)
  455. XART_NUM artnum;
  456. Xint markread;
  457. X{
  458. X#ifdef ASYNC_PARSE
  459. X    if (parse_maybe(artnum))        /* make sure we have right header */
  460. X    return -1;
  461. X#endif
  462. X#ifdef DBM
  463. X    {
  464. X    datum lhs, rhs;
  465. X    datum fetch();
  466. X    register char *idp;
  467. X    char *ident_buf;
  468. X    static FILE * hist_file = Nullfp;
  469. X#else
  470. X    if (
  471. X#ifdef DEBUGGING
  472. X    debug & DEB_FEED_XREF ||
  473. X#endif
  474. X    htype[XREF_LINE].ht_minpos >= 0) {
  475. X                    /* are there article# xrefs? */
  476. X#endif /* DBM */
  477. X    char *xref_buf, *curxref;
  478. X    register char *xartnum;
  479. X    char *rver_buf = Nullch;
  480. X    static char *inews_site = Nullch;
  481. X    register ART_NUM x;
  482. X    char tmpbuf[128];
  483. X    long pos;
  484. X
  485. X#ifdef DBM
  486. X    rver_buf = fetchlines(artnum,NGS_LINE);
  487. X                    /* get Newsgroups */
  488. X    if (!index(rver_buf,','))    /* if no comma, no Xref! */
  489. X        return 0;
  490. X    if (hist_file == Nullfp) {    /* Init. file accesses */
  491. X#ifdef DEBUGGING
  492. X        if (debug)
  493. X        printf ("chase_xref: opening files\n");
  494. X#endif
  495. X        dbminit(filexp(ARTFILE));
  496. X        if ((hist_file = fopen (filexp(ARTFILE), "r")) == Nullfp)
  497. X        return 0;
  498. X    }
  499. X    xref_buf = safemalloc((MEM_SIZE)BUFSIZ);
  500. X    ident_buf = fetchlines(artnum,MESSID_LINE);
  501. X                    /* get Message-ID */
  502. X#ifdef DEBUGGING
  503. X    if (debug)
  504. X        printf ("chase_xref: Message-ID: %s\n", ident_buf);
  505. X#endif
  506. X    idp = ident_buf;
  507. X    while (*++idp)            /* make message-id case insensitive */
  508. X        if (isupper(*idp))
  509. X            *idp = tolower (*idp);
  510. X    lhs.dptr = ident_buf;        /* look up article by id */
  511. X    lhs.dsize = strlen(lhs.dptr) + 1;
  512. X    rhs = fetch(lhs);        /* fetch the record */
  513. X    if (rhs.dptr == NULL)        /* if null, nothing there */
  514. X        goto wild_goose;
  515. X    bcopy((void *)rhs.dptr,(void *)&pos, 4);
  516. X    fseek (hist_file, pos, 0);
  517. X                /* datum returned is position in hist file */
  518. X    fgets (xref_buf, BUFSIZ, hist_file);
  519. X#ifdef DEBUGGING
  520. X    if (debug)
  521. X        printf ("Xref from history: %s\n", xref_buf);
  522. X#endif
  523. X    curxref = cpytill(tmpbuf, xref_buf, '\t') + 1;
  524. X    curxref = cpytill(tmpbuf, curxref, '\t') + 1;
  525. X#ifdef DEBUGGING
  526. X    if (debug)
  527. X        printf ("chase_xref: curxref: %s\n", curxref);
  528. X#endif
  529. X#else /* !DBM */
  530. X#ifdef DEBUGGING
  531. X    if (htype[XREF_LINE].ht_minpos >= 0)
  532. X#endif
  533. X        xref_buf = fetchlines(artnum,XREF_LINE);
  534. X                    /* get xrefs list */
  535. X#ifdef DEBUGGING
  536. X    else {
  537. X        xref_buf = safemalloc((MEM_SIZE)100);
  538. X        printf("Give Xref: ") FLUSH;
  539. X        gets(xref_buf);
  540. X    }
  541. X#endif
  542. X#ifdef DEBUGGING
  543. X    if (debug & DEB_XREF_MARKER)
  544. X        printf("Xref: %s\n",xref_buf) FLUSH;
  545. X#endif
  546. X    curxref = cpytill(tmpbuf,xref_buf,' ') + 1;
  547. X
  548. X    /* Make sure site name on Xref matches what inews thinks site is.
  549. X     * Check first against last inews_site.  If it matches, fine.
  550. X     * If not, fetch inews_site from current Relay-Version line and
  551. X     * check again.  This is so that if the new administrator decides
  552. X     * to change the system name as known to inews, rn will still do
  553. X     * Xrefs correctly--each article need only match itself to be valid.
  554. X     */ 
  555. X    if (inews_site == Nullch || strNE(tmpbuf,inews_site)) {
  556. X#ifndef NORELAY
  557. X        char *t;
  558. X#endif
  559. X        if (inews_site != Nullch)
  560. X        free(inews_site);
  561. X#ifndef NORELAY
  562. X        rver_buf = fetchlines(artnum,RVER_LINE);
  563. X        if ((t = instr(rver_buf,"; site ")) == Nullch)
  564. X#else /* NORELAY */
  565. X          /* In version 2.10.3 of news or afterwards, the Relay-Version
  566. X           * and Posting-Version header lines have been removed.  For
  567. X           * the code below to work as intended, I have modified it to
  568. X           * extract the first component of the Path header line.  This
  569. X           * should give the same effect as did the old code with respect
  570. X           * to the use of the Relay-Version site name.
  571. X           */
  572. X          rver_buf = fetchlines(artnum,PATH_LINE);
  573. X          if (instr(rver_buf,"!") == Nullch)
  574. X#endif /* NORELAY */
  575. X        inews_site = savestr(nullstr);
  576. X        else {
  577. X        char new_site[128];
  578. X
  579. X#ifndef NORELAY
  580. X        cpytill(new_site,t + 7,'.');
  581. X#else /* NORELAY */
  582. X              cpytill(new_site,rver_buf,'!');
  583. X#endif /* NORELAY */
  584. X        inews_site = savestr(new_site);
  585. X        }
  586. X        if (strNE(tmpbuf,inews_site)) {
  587. X#ifdef DEBUGGING
  588. X        if (debug)
  589. X            printf("Xref not from %s--ignoring\n",inews_site) FLUSH;
  590. X#endif
  591. X        goto wild_goose;
  592. X        }
  593. X    }
  594. X#endif /* DBM */
  595. X    while (*curxref) {
  596. X                    /* for each newsgroup */
  597. X        curxref = cpytill(tmpbuf,curxref,' ');
  598. X#ifdef DBM
  599. X        xartnum = index(tmpbuf,'/');
  600. X#else
  601. X        xartnum = index(tmpbuf,':');
  602. X#endif /* DBM */
  603. X        if (!xartnum)        /* probably an old-style Xref */
  604. X        break;
  605. X        *xartnum++ = '\0';
  606. X        if (strNE(tmpbuf,ngname)) {/* not the current newsgroup? */
  607. X        x = atol(xartnum);
  608. X        if (x)
  609. X            if (markread) {
  610. X            if (addartnum(x,tmpbuf))
  611. X                goto wild_goose;
  612. X            }
  613. X#ifdef MCHASE
  614. X            else
  615. X            subartnum(x,tmpbuf);
  616. X#endif
  617. X        }
  618. X        while (*curxref && isspace(*curxref))
  619. X        curxref++;
  620. X    }
  621. X      wild_goose:
  622. X    free(xref_buf);
  623. X#ifdef DBM
  624. X    free(ident_buf);
  625. X#endif /* DBM */
  626. X    if (rver_buf != Nullch)
  627. X        free(rver_buf);
  628. X    }
  629. X    return 0;
  630. X}
  631. X
  632. Xint
  633. Xinitctl()
  634. X{
  635. X    char *mybuf = buf;            /* place to decode rc line */
  636. X    register char *s, *c, *h;
  637. X    register long i;
  638. X    register ART_NUM unread;
  639. X    
  640. X#ifdef DELAYMARK
  641. X    dmcount = 0;
  642. X#endif
  643. X    if ((lastart = getngsize(ng)) < 0)    /* this cannot happen (laugh here) */
  644. X    return -1;
  645. X
  646. X    absfirst = getabsfirst(ng,lastart);    /* remember first existing article */
  647. X    if (!absfirst)            /* no articles at all? */
  648. X    absfirst = 1;            /* pretend there is one */
  649. X#ifndef lint
  650. X    ctlsize = (MEM_SIZE)(OFFSET(lastart)/BITSPERBYTE+20);
  651. X#endif /* lint */
  652. X    ctlarea = safemalloc(ctlsize);    /* allocate control area */
  653. X
  654. X    /* now modify ctlarea to reflect what has already been read */
  655. X
  656. X    for (s = rcline[ng] + rcnums[ng]; *s == ' '; s++) ;
  657. X                    /* find numbers in rc line */
  658. X    i = strlen(s);
  659. X#ifndef lint
  660. X    if (i >= LBUFLEN-2)            /* bigger than buf? */
  661. X    mybuf = safemalloc((MEM_SIZE)(i+2));
  662. X#endif /* lint */
  663. X    strcpy(mybuf,s);            /* make scratch copy of line */
  664. X    mybuf[i++] = ',';            /* put extra comma on the end */
  665. X    mybuf[i] = '\0';
  666. X    s = mybuf;                /* initialize the for loop below */
  667. X    if (strnEQ(s,"1-",2)) {        /* can we save some time here? */
  668. X    firstbit = atol(s+2)+1;        /* ignore first range thusly */
  669. X    s=index(s,',') + 1;
  670. X    }
  671. X    else
  672. X    firstbit = 1;            /* all the bits are valid for now */
  673. X    if (absfirst > firstbit) {        /* do we know already? */
  674. X    firstbit = absfirst;        /* no point calling getngmin again */
  675. X    }
  676. X    else if (artopen(firstbit) == Nullfp) {
  677. X                    /* first unread article missing? */
  678. X    i = getngmin(".",firstbit);    /* see if expire has been busy */
  679. X    if (i) {            /* avoid a bunch of extra opens */
  680. X        firstbit = i;
  681. X    }
  682. X    }
  683. X    firstart = firstbit;        /* firstart > firstbit in KILL */
  684. X#ifdef PENDING
  685. X#   ifdef CACHESUBJ
  686. X    subj_to_get = firstbit;
  687. X#   endif
  688. X#endif
  689. X    unread = lastart - firstbit + 1;    /* assume this range unread */
  690. X    for (i=OFFSET(firstbit)/BITSPERBYTE; i<ctlsize; i++)
  691. X    ctlarea[i] = 0;            /* assume unread */
  692. X#ifdef DEBUGGING
  693. X    if (debug & DEB_CTLAREA_BITMAP) {
  694. X    printf("\n%s\n",mybuf) FLUSH;
  695. X    for (i=1; i <= lastart; i++)
  696. X        if (! was_read(i))
  697. X        printf("%ld ",(long)i) FLUSH;
  698. X    }
  699. X#endif
  700. X    for ( ; (c = index(s,',')) != Nullch; s = ++c) {
  701. X                    /* for each range */
  702. X    ART_NUM min, max;
  703. X
  704. X    *c = '\0';            /* do not let index see past comma */
  705. X    if ((h = index(s,'-')) != Nullch) {    /* is there a -? */
  706. X        min = atol(s);
  707. X        max = atol(h+1);
  708. X        if (min < firstbit)        /* make sure range is in range */
  709. X        min = firstbit;
  710. X        if (max > lastart)
  711. X        max = lastart;
  712. X        if (min <= max)        /* non-null range? */
  713. X        unread -= max - min + 1;/* adjust unread count */
  714. X        for (i=min; i<=max; i++)    /* for all articles in range */
  715. X        ctl_set(i);        /* mark them read */
  716. X    }
  717. X    else if ((i = atol(s)) >= firstbit && i <= lastart) {
  718. X                    /* is single number reasonable? */
  719. X        ctl_set(i);            /* mark it read */
  720. X        unread--;            /* decrement articles to read */
  721. X    }
  722. X#ifdef DEBUGGING
  723. X    if (debug & DEB_CTLAREA_BITMAP) {
  724. X        printf("\n%s\n",s) FLUSH;
  725. X        for (i=1; i <= lastart; i++)
  726. X        if (! was_read(i))
  727. X            printf("%ld ",(long)i) FLUSH;
  728. X    }
  729. X#endif
  730. X    }
  731. X#ifdef DEBUGGING
  732. X    if (debug & DEB_CTLAREA_BITMAP) {
  733. X    fputs("\n(hit CR)",stdout) FLUSH;
  734. X    gets(cmd_buf);
  735. X    }
  736. X#endif
  737. X    if (mybuf != buf)
  738. X    free(mybuf);
  739. X    toread[ng] = unread;
  740. X    return 0;
  741. X}
  742. X
  743. Xvoid
  744. Xgrow_ctl(newlast)
  745. XART_NUM newlast;
  746. X{
  747. X    ART_NUM tmpfirst;
  748. X    MEM_SIZE newsize;
  749. X    register ART_NUM i;
  750. X
  751. X    forcegrow = FALSE;
  752. X    if (newlast > lastart) {
  753. X    ART_NUM tmpart = art;
  754. X#ifndef lint
  755. X    newsize = (MEM_SIZE)(OFFSET(newlast)/BITSPERBYTE+2);
  756. X#else
  757. X    newsize = Null(MEM_SIZE);
  758. X#endif /* lint */
  759. X    if (newsize > ctlsize) {
  760. X        newsize += 20;
  761. X        ctlarea = saferealloc(ctlarea,newsize);
  762. X        ctlsize = newsize;
  763. X    }
  764. X    toread[ng] += (ART_UNREAD)(newlast-lastart);
  765. X    for (i=lastart+1; i<=newlast; i++)
  766. X        ctl_clear(i);    /* these articles are unread */
  767. X#ifdef CACHESUBJ
  768. X    if (subj_list != Null(char**)) {
  769. X#ifndef lint
  770. X        subj_list = (char**)saferealloc((char*)subj_list,
  771. X          (MEM_SIZE)((OFFSET(newlast)+2)*sizeof(char *)) );
  772. X#endif /* lint */
  773. X        for (i=lastart+1; i<=newlast; i++)
  774. X        subj_list[OFFSET(i)] = Nullch;
  775. X    }
  776. X#endif
  777. X    tmpfirst = lastart+1;
  778. X    lastart = newlast;
  779. X#ifdef KILLFILES
  780. X#ifdef VERBOSE
  781. X    IF(verbose)
  782. X        sprintf(buf,
  783. X        "%ld more article%s arrived--looking for more to kill...\n\n",
  784. X        (long)(lastart - tmpfirst + 1),
  785. X        (lastart > tmpfirst ? "s have" : " has" ) );
  786. X    ELSE            /* my, my, how clever we are */
  787. X#endif
  788. X#ifdef TERSE
  789. X        strcpy(buf, "More news--killing...\n\n");
  790. X#endif
  791. X    kill_unwanted(tmpfirst,buf,TRUE);
  792. X#endif
  793. X    art = tmpart;
  794. X    }
  795. X}
  796. X
  797. END_OF_FILE
  798.   if test 17700 -ne `wc -c <'bits.c'`; then
  799.     echo shar: \"'bits.c'\" unpacked with wrong size!
  800.   fi
  801.   # end of 'bits.c'
  802. fi
  803. if test -f 'trn.1.2' -a "${1}" != "-c" ; then 
  804.   echo shar: Will not clobber existing file \"'trn.1.2'\"
  805. else
  806.   echo shar: Extracting \"'trn.1.2'\" \(42762 characters\)
  807.   sed "s/^X//" >'trn.1.2' <<'END_OF_FILE'
  808. X.Ip ^G 8
  809. XThis is a special version of the \*(L'g\*(R' command that is for skipping
  810. Xarticles in a digest.
  811. XIt is equivalent to setting \*(L"\-g4\*(R" and then executing the command
  812. X\*(L"g^Subject:\*(R".
  813. X.Ip TAB 8
  814. XThis is another special version of the \*(L'g\*(R' command that is for
  815. Xskipping inclusions of older articles.
  816. XIt is equivalent to setting \*(L"\-g4\*(R" and then executing the command
  817. X\*(L"g^[^c]\*(R", where \fIc\fR is the first character of the last line
  818. Xon the screen.
  819. XIt searches for the first line that doesn't begin with the same character
  820. Xas the last line on the screen.
  821. X.Ip !command 8
  822. XEscape to a subshell.
  823. X.PP
  824. XThe following commands skip the rest of the current article, then behave just
  825. Xas if typed to the \*(L"What next?\*(R" prompt at the end of the article.
  826. XSee the documentation at the article selection level for these commands.
  827. X.Sp    
  828. X    # $ & / = ? c C f F k K T ^K J , m M r R ^R u U v Y ^
  829. X.br
  830. X    p P ^P - < > [ ] { } number
  831. X.br
  832. X    range{,range} command{:command}
  833. X.Sp
  834. XThe following commands also skip to the end of the article, but have the
  835. Xadditional effect of marking the current article as read:
  836. X.Sp
  837. X    n N ^N e s S | w W
  838. X.Sp
  839. X.Sh "Miscellaneous facts about commands"
  840. XAn \*(L'n\*(R' typed at either the \*(L"Last newsgroup\*(R" prompt or a
  841. X\*(L"Last article\*(R" prompt will cycle back to the top of the newsgroup
  842. Xor article list, whereas a \*(L'q\*(R' will quit the level.
  843. X(Note that \*(L'n\*(R' does not mean \*(L"no\*(R", but rather
  844. X\*(L"next\*(R".)
  845. XA space will of course do whatever is shown as the
  846. Xdefault, which will vary depending on whether
  847. X.I trn
  848. Xthinks you have more articles or newsgroups to read.
  849. X.PP
  850. XThe \*(L'b\*(R' (backup page) command may be repeated until the beginning of
  851. Xthe article is reached.
  852. XIf
  853. X.I trn
  854. Xis suspended (via a ^Z), then when the job is resumed, a refresh (^L) will
  855. Xautomatically be done (Berkeley-type systems only).
  856. XIf you type a command such as \*(L'!\*(R' or \*(L's\*(R' which takes you
  857. Xfrom the middle of the article to the end, you can always get back into the
  858. Xmiddle by typing \*(L'^L\*(R'.
  859. X.PP
  860. XIn multi-character commands such as \*(L'!\*(R', \*(L's\*(R', \*(L'/\*(R',
  861. Xetc, you can interpolate various run-time values by typing escape and a
  862. Xcharacter.
  863. XTo find out what you can interpolate, type escape and \*(L'h\*(R', or check
  864. Xout the single character % substitutions for environment variables in the
  865. XInterpretation and Interpolation section, which are the same.
  866. XAdditionally, typing a double escape will cause any % substitutions in the
  867. Xstring already typed in to be expanded.
  868. X.Sh "The Tree Display"
  869. XWhen reading a threaded newsgroup,
  870. X.I trn
  871. Xdisplays a character representation of the article tree in the upper right
  872. Xcorner of the header.
  873. XFor example, consider the following display:
  874. X.Sp
  875. X.nf
  876. X    (1)+-(1)--(\fI2\fP)--\fI[2]\fP
  877. X       |-(1)+-[3]
  878. X       |    \\-[1]
  879. X       \\-(1)+-[1]--[1]
  880. X            \\-[1]
  881. X.fi
  882. X.Sp
  883. XThis tree represents an initial article that has three direct replies
  884. X(the second column with three (1)'s).
  885. XEach reply has further replies branching off from them.
  886. XIn two cases the subject line was altered in the reply, as indicated
  887. Xby the increasing numbers.
  888. XWhen there is only one subject associated with a thread, all the nodes
  889. Xare marked with the number 1.
  890. XWhen the first subject change arrives, it is marked with the number 2,
  891. Xand so on.
  892. XIf you were to look at this thread in the thread selector, the three
  893. Xsubjects associated with it would be listed in the same order as the
  894. Xascending digits.
  895. XIn those rare cases where more than 9 subjects are associated with each
  896. Xthread, the nodes are marked with the letters A-Z, and then by a-z.
  897. XThe articles that have already been read are enclosed in ()'s.
  898. XUnread articles are displayed in []'s.
  899. XThe currently displayed article has its entire node highlighted in the
  900. Xdisplay.
  901. XThe previously displayed article has only its number highlighted.
  902. X.Sh "Options"
  903. X.I Trn
  904. Xhas a nice set of options to allow you to tailor the interaction
  905. Xto your liking.
  906. X(You might like to know that the author swears by
  907. X\*(L"\-x6ls \-e \+m \-S -XX -N\*(R".)
  908. XThese options may be set on the command line, via the RNINIT
  909. Xenvironment variable, via a file pointed to by the RNINIT variable, or
  910. Xfrom within
  911. X.I trn
  912. Xvia the & command.
  913. XOptions may generally be unset by typing \*(L"+switch\*(R".
  914. XOptions include:
  915. X.TP 5
  916. X.B \-a
  917. Xturns on the alpha-numeric mode of the thread-selector.
  918. XThis option has no affect unless
  919. X.B \-x
  920. Xis also specified (or is the default on your system).
  921. X.TP 5
  922. X.B \-c
  923. Xchecks for news without reading news.
  924. XIf a list of newsgroups is given on the command line, only those newsgroups
  925. Xwill be checked; otherwise all subscribed-to newsgroups are checked.
  926. XWhenever the
  927. X.B \-c
  928. Xswitch is specified, a non-zero exit status from
  929. X.I trn
  930. Xmeans that there is unread news in one of the checked newsgroups.
  931. XThe
  932. X.B \-c
  933. Xswitch does not disable the printing of newsgroups with unread news;
  934. Xthis is controlled by the
  935. X.B \-s
  936. Xswitch.
  937. X(The
  938. X.B \-c
  939. Xswitch is not meaningful when given via the & command.)
  940. X.TP 5
  941. X.B \-C<number>
  942. Xtells
  943. X.I trn
  944. Xhow often to checkpoint the
  945. X.IR .newsrc ,
  946. Xin articles read.
  947. XActually, this number says when to start thinking about doing a checkpoint
  948. Xif the situation is right.
  949. XIf a reasonable checkpointing situation doesn't arise within 10 more
  950. Xarticles, the
  951. X.I .newsrc
  952. Xis checkpointed willy-nilly.
  953. X.TP 5
  954. X.B \-d<directory name>
  955. Xsets the default save directory to something other than ~/News.
  956. XThe directory name will be globbed (via csh) if necessary (and if possible).
  957. XArticles saved by
  958. X.I trn
  959. Xmay be placed in the save directory or in a subdirectory thereof depending
  960. Xon the command that you give and the state of the environment variables
  961. XSAVEDIR and SAVENAME.
  962. XAny KILL files (see the K command in the Article Selection section)
  963. Xalso reside in this directory and its subdirectories, by default.
  964. XIn addition, shell escapes leave you in this directory.
  965. X.TP 5
  966. X.B \-D<flags>
  967. Xenables debugging output.
  968. XSee common.h for flag values.
  969. XWarning: normally
  970. X.I trn
  971. Xattempts to restore your
  972. X.I .newsrc
  973. Xwhen an unexpected signal or internal error occurs.
  974. XThis is disabled when any debugging flags are set.
  975. X.TP 5
  976. X.B \-e
  977. Xcauses each page within an article to be started at the top of the screen,
  978. Xnot just the first page.
  979. X(It is similar to the
  980. X.B \-c
  981. Xswitch of
  982. X.IR more (1).)
  983. XYou never have to read scrolling text with this switch.
  984. XThis is helpful especially at certain baud rates because you can start reading
  985. Xthe top of the next page without waiting for the whole page to be printed.
  986. XIt works nicely in conjuction with the
  987. X.B \-m
  988. Xswitch, especially if you use half-intensity for your highlight mode.
  989. XSee also the
  990. X.B \-L
  991. Xswitch.
  992. X.TP 5
  993. X.B \-E<name>=<val>
  994. Xsets the environment variable <name> to the value specified.
  995. XWithin
  996. X.IR trn ,
  997. X\*(L"&\-ESAVENAME=%t\*(R" is similar to \*(L"setenv SAVENAME '%t'\*(R" in
  998. X.IR csh ,
  999. Xor \*(L"SAVENAME='%t'; export SAVENAME\*(R" in
  1000. X.IR sh .
  1001. XAny environment variables set with
  1002. X.B \-E
  1003. Xwill be inherited by subprocesses of
  1004. X.IR trn .
  1005. X.TP 5
  1006. X.B \-F<string>
  1007. Xsets the prefix string for the \*(L'F\*(R' followup command to use in
  1008. Xprefixing each line of the quoted article.
  1009. XFor example, \*(L"\-F<tab>\*(R" inserts a tab on the front of each line
  1010. X(which will cause long lines to wrap around, unfortunately),
  1011. X\*(L"\-F>>>>\*(R" inserts \*(L">>>>\*(R" on every line, and
  1012. X\*(L"\-F\*(R" by itself causes nothing to be inserted, in case you want to
  1013. Xreformat the text, for instance.
  1014. XThe initial default prefix is \*(L">\*(R".
  1015. X.TP 5
  1016. X.B \-g<line>
  1017. Xtells
  1018. X.I trn
  1019. Xwhich line of the screen you want searched-for strings to show up on when
  1020. Xyou search with the \*(L'g\*(R' command within an article.
  1021. XThe lines are numbered starting with 1.
  1022. XThe initial default is \*(L"\-g1\*(R", meaning the first line of the screen.
  1023. XSetting the line to less than 1 or more than the number of lines on the screen
  1024. Xwill set it to the last line of the screen.
  1025. X.TP 5
  1026. X.B \-h<string>
  1027. Xhides (disables the printing of) all header lines beginning with
  1028. X.I string.
  1029. XFor instance, \-hexp will disable the printing of the \*(L"Expires:\*(R" line.
  1030. XCase is insignificant.
  1031. XIf <string> is null, all header lines except Subject are hidden, and you
  1032. Xmay then use
  1033. X.B +h
  1034. Xto select those lines you want to see.
  1035. XYou may wish to use the baud-rate switch modifier below to hide more lines
  1036. Xat lower baud rates.
  1037. X.TP 5
  1038. X.B \-H<string>
  1039. Xworks just like
  1040. X.B \-h
  1041. Xexcept that instead of setting the hiding flag for a header line, it sets
  1042. Xthe magic flag for that header line.
  1043. XCertain header lines have magic behavior that can be controlled this way.
  1044. XAt present, the following actions are caused by the flag for the particular
  1045. Xline:
  1046. Xthe Newsgroups line will only print when there are multiple newsgroups;
  1047. Xthe Subject line will be underlined and (when threaded) the
  1048. Xkeyword \*(L'Subject:\*(R' is replaced by its subject number (e.g. [1]);
  1049. Xthe Expires line will always be suppressed if there is nothing on it;
  1050. Xthe name line is shortened to just the comment portion (the part
  1051. Xwithin parenthesis) if available; the date line is displayed in local
  1052. Xtime if the group is threaded.
  1053. XIn fact, all of these actions are the default, and you must use
  1054. X.B +H
  1055. Xto undo them.
  1056. X.TP 5
  1057. X.B \-i=<number>
  1058. Xspecifies how long (in lines) to consider the initial page of an
  1059. Xarticle\*(--normally this is determined automatically depending on baud rate.
  1060. X(Note that an entire article header will always be printed regardless of the
  1061. Xspecified initial page length.
  1062. XIf you are working at low baud rate and wish to reduce the size of the
  1063. Xheaders, you may hide certain header lines with the
  1064. X.B \(bsh
  1065. Xswitch.)
  1066. X.TP 5
  1067. X.B \-l
  1068. Xdisables the clearing of the screen at the beginning of each
  1069. Xarticle, in case you have a bizarre terminal.
  1070. X.TP 5
  1071. X.B \-L
  1072. Xtells
  1073. X.I trn
  1074. Xto leave information on the screen as long as possible by not blanking
  1075. Xthe screen between pages, and by using clear to end-of-line.
  1076. X(The
  1077. X.IR more (1)
  1078. Xprogram does this.)
  1079. XThis feature works only if you have the requisite termcap
  1080. Xcapabilities.
  1081. XThe switch has no effect unless the
  1082. X.B \-e
  1083. Xswitch is set.
  1084. X.TP 5
  1085. X.B \-m=<mode>
  1086. Xenables the marking of the last line of the previous page
  1087. Xprinted, to help the user see where to continue reading.
  1088. XThis is most helpful when less than a full page is going to be displayed.
  1089. XIt may also be used in conjunction with the
  1090. X.B \-e
  1091. Xswitch, in which case the page is erased, and the first line (which is
  1092. Xthe last line of the previous page) is highlighted.
  1093. XIf
  1094. X.B \-m=s
  1095. Xis specified, the standout mode will be used, but if
  1096. X.B \-m=u
  1097. Xis specified, underlining will be used.
  1098. XIf neither
  1099. X.B =s
  1100. Xor
  1101. X.B =u
  1102. Xis specified, standout is the default.
  1103. XUse
  1104. X.B +m
  1105. Xto disable highlighting.
  1106. X.TP 5
  1107. X.B \-M
  1108. Xforces mailbox format in creating new save files.
  1109. XOrdinarily you are asked which format you want.
  1110. X.TP 5
  1111. X.B \-N
  1112. Xforces normal (non-mailbox) format in creating new save files.
  1113. XOrdinarily you are asked which format you want.
  1114. X.TP 5
  1115. X.B \-q
  1116. Xbypasses the automatic check for new newsgroups when starting 
  1117. X.I trn.
  1118. X.TP 5
  1119. X.B \-r
  1120. Xcauses
  1121. X.I trn
  1122. Xto restart in the last newsgroup read during a previous session with
  1123. X.I trn.
  1124. XIt is equivalent to starting up normally and then getting to the newsgroup
  1125. Xwith a g command.
  1126. X.TP 5
  1127. X.B \-s
  1128. Xwith no argument suppresses the initial listing of newsgroups with unread
  1129. Xnews, whether
  1130. X.B \-c
  1131. Xis specified or not.
  1132. XThus
  1133. X.B \-c
  1134. Xand
  1135. X.B \-s
  1136. Xcan be used together to test \*(L"silently\*(R" the status of news from
  1137. Xwithin your
  1138. X.I .login
  1139. Xfile.
  1140. XIf
  1141. X.B \-s
  1142. Xis followed by a number, the initial listing is suppressed after that many
  1143. Xlines have been listed.
  1144. XPresuming that you have your
  1145. X.I .newsrc
  1146. Xsorted into order of interest,
  1147. X.B \-s5
  1148. Xwill tell you the 5 most interesting newsgroups that have unread news.
  1149. XThis is also a nice feature to use in your
  1150. X.I .login
  1151. Xfile, since it not only tells you whether there is unread news, but also how
  1152. Ximportant the unread news is, without having to wade through the entire
  1153. Xlist of unread newsgroups.
  1154. XIf no 
  1155. X.B \-s
  1156. Xswitch is given 
  1157. X.B \-s5
  1158. Xis assumed, so just putting \*(L"rn \-c\*(R"
  1159. Xinto your
  1160. X\&.login file is fine.
  1161. X.TP 5
  1162. X.B \-S<number>
  1163. Xcauses
  1164. X.I trn
  1165. Xto enter subject search mode (^N) automatically whenever an unthreaded
  1166. Xnewsgroup is
  1167. Xstarted up with <number> unread articles or more.
  1168. XAdditionally, it causes any \*(L'n\*(R' typed while in subject search mode
  1169. Xto be interpreted as \*(L'^N\*(R' instead.
  1170. X(To get back out of subject search mode, the best command is probably
  1171. X\&\*(L'^\*(R'.)
  1172. XIf <number> is omitted, 3 is assumed.
  1173. X.TP 5
  1174. X.B \-t
  1175. Xputs
  1176. X.I trn
  1177. Xinto terse mode.
  1178. XThis is more cryptic but useful for low baud rates.
  1179. X(Note that your system administrator may have compiled
  1180. X.I trn
  1181. Xwith either verbose or terse messages only to save memory.)
  1182. XYou may wish to use the baud-rate switch modifier below to enable terse mode
  1183. Xonly at lower baud rates.
  1184. X.TP 5
  1185. X.B \-T
  1186. Xallows you to type ahead of rn.
  1187. XOrdinarily rn will eat typeahead to prevent your autorepeating space bar from
  1188. Xdoing a very frustrating thing when you accidentally hold it down.
  1189. XIf you don't have a repeating space bar, or you are working at low baud
  1190. Xrate, you can set this switch to prevent this behavior.
  1191. XYou may wish to use the baud-rate switch modifier below to disable typeahead
  1192. Xonly at lower baud rates.
  1193. X.TP 5
  1194. X.B \-v
  1195. Xsets verification mode for commands.
  1196. XWhen set, the command being executed is displayed to give some feedback that
  1197. Xthe key has actually been typed.
  1198. XUseful when the system is heavily loaded and you give a command that takes
  1199. Xa while to start up.
  1200. X.TP 5
  1201. X.B \-x<number><list>
  1202. XEnable the extended (threaded) features of
  1203. X.I trn
  1204. Xbeyond the traditional
  1205. X.I rn
  1206. Xcompatibility mode.
  1207. X(This may be the default on your system, use +x if you yearn for the good
  1208. Xol' days.)
  1209. XThe <number> is the maximum number of article-tree lines (from 0 to 11)
  1210. Xyou want displayed in your header.
  1211. XUse the <list> to choose which thread selector modes you like (s \- short,
  1212. Xm \- medium, or l \- long), and in what order they are selected with the
  1213. X\&\*(L'L\*(R' command.
  1214. XFor example, use
  1215. X.B \-xls
  1216. Xto start with the long display mode and only switch between it and
  1217. Xthe short mode.
  1218. XYou can omit either or both of the parameters, in which case a default of
  1219. X.B \-x6lsm
  1220. Xis assumed.
  1221. X.TP 5
  1222. X.B \-X<number><commands>
  1223. XIf you like using the thread selector, you'll probably want to use this
  1224. Xoption to make the thread selector command (+) the default when a newsgroup
  1225. Xis started up with at least <number> unread articles.
  1226. X(Your installer may have chosen to make -X1 the default on your system.)
  1227. XIt is also used to select which commands you want to be the defaults while
  1228. Xusing the thread selector.
  1229. XFor example,
  1230. X.B \-X2XD
  1231. Xwill make the thread selector the default command for entering a newsgroup
  1232. Xwith at least 2 unread articles, and set the default command for the LAST
  1233. Xpage of the thread selector to be the
  1234. X.B X
  1235. Xcommand and the default command for all other pages to be the
  1236. X.B D
  1237. Xcommand.
  1238. XEither or both parameters can be omitted, as well as the second default
  1239. Xcommand (e.g.
  1240. X.B \-XX
  1241. Xwould change the default newsgroup entry to use the selector and the default
  1242. Xcommand for the last page of the selector to be \*(L'X\*(R').
  1243. XThe default is
  1244. X.B \-X1Z>
  1245. Xif just
  1246. X.B \-X
  1247. Xis specified.
  1248. XTo set the default selector commands without affecting the default entry
  1249. Xinto a newsgroup, specify a high number, like 9999.
  1250. X.TP 5
  1251. X.B \-/
  1252. Xsets SAVEDIR to \*(L"%p/%c\*(R" and SAVENAME to \*(L"%a\*(R", which means
  1253. Xthat by default articles are saved in a subdirectory of your private news
  1254. Xdirectory corresponding to the name of the the current newsgroup, with the
  1255. Xfilename being the article number.
  1256. X.B +/
  1257. Xsets SAVEDIR to \*(L"%p\*(R" and SAVENAME to \*(L"%^C\*(R", which by
  1258. Xdefault saves articles directly to your private news directory, with the
  1259. Xfilename being the name of the current newsgroup, first letter capitalized.
  1260. X(Either
  1261. X.B +/
  1262. Xor
  1263. X.B \-/
  1264. Xmay be default on your system, depending on the feelings of your news
  1265. Xadministrator when he, she or it installed
  1266. X.IR trn .)
  1267. XYou may, of course, explicitly set SAVEDIR and SAVENAME to other values\*(--see
  1268. Xdiscussion in the environment section.
  1269. X.PP
  1270. XAny switch may be selectively applied according to the current baud-rate.
  1271. XSimply prefix the switch with +speed to apply the switch at that speed or
  1272. Xgreater, and \%\-speed to apply the switch at that speed or less.
  1273. XExamples: \%\-1200\-hposted suppresses the Posted line at 1200 baud or less;
  1274. X\%+9600\-m enables marking at 9600 baud or more.
  1275. XYou can apply the modifier recursively to itself also: \%+300\-1200\-t sets
  1276. Xterse mode from 300 to 1200 baud.
  1277. X.PP
  1278. XSimilarly, switches may be selected based on terminal type:
  1279. X.Sp
  1280. X    \-=vt100+T        set +T on vt100
  1281. X.br
  1282. X    \-=tvi920\-ETERM=mytvi    get a special termcap entry
  1283. X.br
  1284. X    \-=tvi920\-ERNMACRO=%./.rnmac.tvi
  1285. X.br
  1286. X                set up special keymappings
  1287. X.br
  1288. X    +=paper\-v        set verify mode if not hardcopy
  1289. X.PP
  1290. XSome switch arguments, such as environment variable values, may require
  1291. Xspaces in them.
  1292. XSuch spaces should be quoted via ", ', or \e in the conventional fashion,
  1293. Xeven when passed via RNINIT or the & command.
  1294. X.Sh "Regular Expressions"
  1295. XThe patterns used in article searching are regular expressions such as
  1296. Xthose used by
  1297. X.IR ed (1).
  1298. XIn addition, \ew matches an alphanumeric character and \eW a nonalphanumeric.
  1299. XWord boundaries may be matched by \eb, and non-boundaries by \eB.
  1300. XThe bracketing construct \e(\ ...\ \e) may also be used, and \edigit matches
  1301. Xthe digit'th substring, where digit can range from 1 to 9.
  1302. X\e0 matches whatever the last bracket match matched.
  1303. XUp to 10 alternatives may given in a pattern, separated by \e|, with the
  1304. Xcaveat that \e(\ ...\ \e|\ ...\ \e) is illegal.
  1305. X.Sh "Interpretation and Interpolation"
  1306. XMany of the strings that
  1307. X.I trn
  1308. Xhandles are subject to interpretations of several types.
  1309. XUnder filename expansion, an initial \*(L"~/\*(R" is translated to the name
  1310. Xof your home directory, and \*(L"~name\*(R" is translated to the login
  1311. Xdirectory for the user specified.
  1312. XFilename expansion will also expand an initial environment variable, and
  1313. Xalso does the backslash, uparrow and percent expansion mentioned below.
  1314. X.PP
  1315. XAll interpreted strings go through backslash, uparrow and percent
  1316. Xinterpretation.
  1317. XThe backslash escapes are the normal ones (such as \en, \et, \ennn, etc.).
  1318. XThe uparrow escapes indicate control codes in the normal fashion.
  1319. XBackslashes or uparrows to be passed through should be escaped with backslash.
  1320. XThe special percent escapes are similar to printf percent escapes.
  1321. XThese cause the substitution of various run-time values into the string.
  1322. XThe following are currently recognized:
  1323. X.Ip %a 8
  1324. XCurrent article number.
  1325. X.Ip %A 8
  1326. XFull name of current article (%P/%c/%a).
  1327. X(On a Eunice system with the LINKART option, %P/%c/%a returns the name of
  1328. Xthe article in the current newsgroup, while %A returns the real name of
  1329. Xthe article, which may be different if the current article was posted to
  1330. Xmultiple newsgroups.)
  1331. X.Ip %b 8
  1332. XDestination of last save command, often a mailbox.
  1333. X.Ip %B 8
  1334. XThe byte offset to the beginning of the part of the article to be saved,
  1335. Xset by the save command.
  1336. XThe \*(L's\*(R' and \*(L'S\*(R' commands set it to 0, and the \*(L'w\*(R'
  1337. Xand \*(L'W\*(R' commands set it to the byte offset of the body of the article.
  1338. X.Ip %c 8
  1339. XCurrent newsgroup, directory form.
  1340. X.Ip %C 8
  1341. XCurrent newsgroup, dot form.
  1342. X.Ip %d 8
  1343. XFull name of newsgroup directory (%P/%c).
  1344. X.Ip %D 8
  1345. X\*(L"Distribution:\*(R" line from the current article.
  1346. X.Ip %e 8
  1347. XThe last command executed to extract data from an article.
  1348. X.Ip %E 8
  1349. XThe number of extra (unselected) articles, not counting the current article
  1350. Xif it is unselected.
  1351. X.Ip %f 8
  1352. X\*(L"From:\*(R" line from the current article, or the \*(L"Reply-To:\*(R"
  1353. Xline if there is one.
  1354. XThis differs from %t in that comments (such as the full name) are not
  1355. Xstripped out with %f.
  1356. X.Ip %F 8
  1357. X\*(L"Newsgroups:\*(R" line for a new article, constructed from
  1358. X\*(L"Newsgroups:\*(R" and \*(L"Followup-To:\*(R" lines of current article.
  1359. X.Ip %h 8
  1360. XName of the header file to pass to the mail or news poster,
  1361. Xcontaining all the information that the poster program needs in the
  1362. Xform of a message header.
  1363. XIt may also contain a copy of the current article.
  1364. XThe format of the header file is controlled by the MAILHEADER and NEWSHEADER
  1365. Xenvironment variables.
  1366. X.Ip %H 8
  1367. XHost name (your machine's name).
  1368. X.Ip %i 8
  1369. X\*(L"Message-I.D.:\*(R" line from the current article, with <> guaranteed.
  1370. X.Ip %I 8
  1371. XThe reference indication mark (see the
  1372. X.B \-F
  1373. Xswitch.)
  1374. X.Ip %l 8
  1375. XThe news administrator's login name, if any.
  1376. X.Ip %L 8
  1377. XLogin name (yours).
  1378. X.Ip %m 8
  1379. XThe current mode of
  1380. X.I trn,
  1381. Xfor use in conditional macros.
  1382. X.Sp
  1383. X.nf
  1384. X    i    Initializing.
  1385. X    n    Newsgroup selection level.
  1386. X    t    Thread selection level.
  1387. X    a    Article selection level (What next?).
  1388. X    p    Pager level (MORE prompt).
  1389. X    u    Set unread? prompt.
  1390. X    A    Add this newsgroup?
  1391. X    C    Catchup confirmation.
  1392. X    D    Delete bogus newsgroups?
  1393. X    M    Use mailbox format?
  1394. X    R    Resubscribe to this newsgroup?
  1395. X.fi
  1396. X.Sp
  1397. XNote that yes/no questions are all upper-case modes.
  1398. XIf, for example, you wanted to disallow defaults on all yes/no questions,
  1399. Xyou could define the following macro:
  1400. X.Sp
  1401. X.nf
  1402. X\e040    %(%m=[A-Z]?h: )
  1403. X.fi
  1404. X.Ip %M 8
  1405. XThe number of articles marked to return via the \*(L'M\*(R' command.
  1406. XIf the same article is Marked multiple times, \*(L"%M\*(R" counts it
  1407. Xmultiple times in the current implementation.
  1408. X.Ip %n 8
  1409. X\*(L"Newsgroups:\*(R" line from the current article.
  1410. X.Ip %N 8
  1411. XFull name (yours).
  1412. X.Ip %o 8
  1413. XOrganization (yours).
  1414. X.Ip %O 8
  1415. XOriginal working directory (where you ran rn from).
  1416. X.Ip %p 8
  1417. XYour private news directory, normally ~/News.
  1418. X.Ip %P 8
  1419. XPublic news spool directory, normally /usr/spool/news on systems that don't use NNTP.
  1420. X.Ip %r 8
  1421. XLast reference on references line of current article (parent article id).
  1422. X.Ip %R 8
  1423. XReferences list for a new article, constructed from the references and article
  1424. XID of the current article.
  1425. X.Ip %s 8
  1426. XSubject, with all Re's and (nf)'s stripped off.
  1427. X.Ip %S 8
  1428. XSubject, with one \*(L"Re:\*(R" stripped off.
  1429. X.Ip %t 8
  1430. X\*(L"To:\*(R" line derived from the \*(L"From:\*(R" and \*(L"Reply-To:\*(R"
  1431. Xlines of the current article.
  1432. XThis always returns an Internet format address.
  1433. X.Ip %T 8
  1434. X\*(L"To:\*(R" line derived from the \*(L"Path:\*(R" line of the
  1435. Xcurrent article to produce a uucp path.
  1436. X.Ip %u 8
  1437. XThe number of unread articles in the current newsgroup.
  1438. X.Ip %U 8
  1439. XThe number of unread articles in the current newsgroup, not counting the
  1440. Xthe current article.
  1441. XWhen threads are selected, this count reflects only selected articles.
  1442. X.Ip %x 8
  1443. XThe news library directory.
  1444. X.Ip %X 8
  1445. XThe rn library directory.
  1446. X.Ip %z 8
  1447. XThe length of the current article in bytes.
  1448. X.Ip %Z 8
  1449. XThe number of selected threads.
  1450. X.Ip %~ 8
  1451. XYour home directory.
  1452. X.Ip %. 8
  1453. XThe directory containing your dot files, which is your home directory unless
  1454. Xthe environment variable DOTDIR is defined when rn is invoked.
  1455. X.Ip %# 8
  1456. XA counter incremented during multiple-article commands.
  1457. XPrior to executing any such commands, it will return 0.
  1458. XDuring a multi-article command, it returns the current count starting from 1.
  1459. XAfterward, it retains its final value.
  1460. XFor example, the command
  1461. X.Sp
  1462. X    1003-1008 s my.%#
  1463. X.Sp
  1464. Xwould save articles 1003 through 1008 in the files my.1 through my.6.
  1465. X.Ip %$ 8
  1466. XCurrent process number.
  1467. X.Ip %/ 8
  1468. XLast search string.
  1469. X.Ip %% 8
  1470. XA percent sign.
  1471. X.Ip "%{name} or %{name\-default}" 8
  1472. XThe environment variable \*(L"name\*(R".
  1473. X.Ip %[name] 8
  1474. XThe value of header line \*(L"Name:\*(R" from the current article.
  1475. XThe \*(L"Name:\ \*(R" is not included.
  1476. XFor example \*(L"%D\*(R" and \*(L"%[distribution]\*(R" are equivalent.
  1477. XThe name must be spelled out in full.
  1478. X.Ip %`command` 8
  1479. XInserts the output of the command, with any embedded newlines translated
  1480. Xto space.
  1481. X.Ip %""prompt"" 8
  1482. XPrints prompt on the terminal, then inputs one string, and inserts it.
  1483. X.Ip "%(test_text=pattern?then_text:else_text)" 8
  1484. XIf
  1485. X.I test_text
  1486. Xmatches
  1487. X.IR pattern ,
  1488. Xhas the value
  1489. X.IR then_text ,
  1490. Xotherwise
  1491. X.IR else_text .
  1492. XThe \*(L":else_text\*(R" is optional, and if absent, interpolates the null string.
  1493. XThe = may be replaced with != to negate the test.
  1494. XTo quote any of the metacharacters
  1495. X(\*(L'=\*(R', \*(L'?\*(R', \*(L':\*(R', or \*(L')\*(R'),
  1496. Xprecede with a backslash.
  1497. X.Ip %digit 8
  1498. XThe digits 1 through 9 interpolate the string matched by the nth bracket
  1499. Xin the last pattern match that had brackets.
  1500. XIf the last pattern had alternatives, you may not know the number of the
  1501. Xbracket you want\*(--%0 will give you the last bracket matched.
  1502. X.PP
  1503. XModifiers: to capitalize the first letter, insert \*(L'^\*(R':
  1504. X\*(L"%^C\*(R" produces something like \*(L"Net.jokes\*(R".
  1505. XInserting \*(L'_\*(R' causes the first letter following the last
  1506. X\&\*(L'/\*(R' to be capitalized: \*(L"%_c\*(R" produces \*(L"net/Jokes\*(R".
  1507. X.SH ENVIRONMENT
  1508. XThe following environment variables are paid attention to by
  1509. X.IR trn .
  1510. XIn general the default values assumed for these variables by
  1511. X.I trn
  1512. Xare reasonable, so if you are using
  1513. X.I trn
  1514. Xfor the first time, you can safely ignore this section.
  1515. XNote that the defaults below may not correspond precisely to the defaults
  1516. Xon your system.
  1517. XTo find the actual defaults you would need to look in config.h and common.h
  1518. Xin the trn source directory, and the file INIT in the trn library.
  1519. X.PP
  1520. XThose variables marked (%) are subject to % interpolation, and those marked
  1521. X(~) are subject to both % interpolation and ~ interpretation.
  1522. X.Ip "ATTRIBUTION (%)" 8
  1523. XGives the format of the attribution line in front of the quoted article
  1524. Xincluded by an F command.
  1525. X.Sp
  1526. XDefault: In article %i %f writes:
  1527. X.Ip "CANCEL (~)" 8
  1528. XThe shell command used to cancel an article.
  1529. X.Sp
  1530. XDefault: inews \-h < %h
  1531. X.Ip "CANCELHEADER (%)" 8 13v
  1532. XThe format of the file to pass to the CANCEL command in order to cancel
  1533. Xan article.
  1534. X.Sp
  1535. XDefault:
  1536. X.br
  1537. XNewsgroups: %n
  1538. X.br
  1539. XSubject: cmsg cancel %i
  1540. X.br
  1541. XReferences: %R
  1542. X.br
  1543. XReply-To: %L@%H (%N)
  1544. X.br
  1545. XDistribution: %D
  1546. X.br
  1547. XOrganization: %o
  1548. X.sp 1
  1549. X%i cancelled from rn.
  1550. X.Ip DOTDIR 8
  1551. XWhere to find your dot files, if they aren't in your home directory.
  1552. XCan be interpolated using \*(L"%.\*(R".
  1553. X.Sp
  1554. XDefault: $HOME
  1555. X.Ip "EDITOR (~)" 8
  1556. XThe name of your editor, if VISUAL is undefined.
  1557. X.Sp
  1558. XDefault: whatever your news administrator compiled in, usually vi.
  1559. X.Ip "EXSAVER (%)" 8
  1560. XThe shell command to execute in order to extract data to either /bin/sh
  1561. Xor a user-specified command.
  1562. X.Sp
  1563. XDefault: tail +%Bc %A | %e
  1564. X.Ip "FIRSTLINE (%)" 8
  1565. XControls the format of the line displayed at the top of an article.
  1566. XWarning: this may go away.
  1567. X.Sp
  1568. XThe default in an unthreaded group is approximately:
  1569. X.Sp
  1570. XArticle %a %(%U%M!=^00$?(%U more%(%M!=^0$? + %M Marked to return)\e) )in %C:
  1571. X.Sp
  1572. XWhile the default in a threaded group is almost:
  1573. X.Sp
  1574. X%C #%a%(%Z=^0$?%(%U!=^0$? (%U more\e)): (%U + %E more\e))
  1575. X.Ip HIDELINE 8
  1576. XIf defined, contains a regular expression which matches article lines to
  1577. Xbe hidden, in order, for instance, to suppress quoted material.
  1578. XA recommended string for this purpose is \*(L"^>...\*(R", which \fIdoesn't\fR
  1579. Xhide lines with only \*(L'>\*(R', to give some indication that quoted
  1580. Xmaterial is being skipped.
  1581. XIf you want to hide more than one pattern, you can use \*(L"\||\|\*(R" to
  1582. Xseparate the alternatives.
  1583. XYou can view the hidden lines by restarting the article with the \*(L'v\*(R'
  1584. Xcommand.
  1585. X.Sp
  1586. XThere is some overhead involved in matching each line of the article against
  1587. Xa regular expression.
  1588. XYou might wish to use a baud-rate modifier to enable this feature only at
  1589. Xlow baud rates.
  1590. X.Sp
  1591. XDefault: undefined
  1592. X.Ip HOME 8
  1593. XYour home directory.
  1594. XAffects ~ interpretation, and the location of your
  1595. Xdot files if DOTDIR is not defined.
  1596. X.Sp
  1597. XDefault: $LOGDIR
  1598. X.Ip "KILLGLOBAL (~)" 8
  1599. XWhere to find the KILL file to apply to every newsgroup.
  1600. XSee the \*(L'^K\*(R' command at the newsgroup selection level.
  1601. X.Sp
  1602. XDefault: %p/KILL
  1603. X.Ip "KILLLOCAL (~)" 8
  1604. XWhere to find the KILL file for the current newsgroup.
  1605. XSee the commands \*(L'K\*(R' and \*(L'^K\*(R' at the article selection level,
  1606. Xand the search modifier \*(L'K\*(R'.
  1607. X.Sp
  1608. XDefault: %p/%c/KILL
  1609. X.Ip LOGDIR 8
  1610. XYour home directory if HOME is undefined.
  1611. XAffects ~ interpretation, and the location of your
  1612. Xdot files if DOTDIR is not defined.
  1613. X.Sp
  1614. XDefault: none.
  1615. X.Sp
  1616. XExplanation: you must have either $HOME or $LOGDIR.
  1617. X.Ip LOGNAME 8
  1618. XYour login name, if USER is undefined.
  1619. XMay be interpolated using \*(L"%L\*(R".
  1620. X.Sp
  1621. XDefault: value of getlogin().
  1622. X.Ip "MAILCALL (~)" 8
  1623. XWhat to say when there is new mail.
  1624. X.Sp
  1625. XDefault: (Mail)
  1626. X.Ip "MAILFILE (~)" 8
  1627. XWhere to check for mail.
  1628. X.Sp
  1629. XDefault: /usr/spool/mail/%L
  1630. X.Ip "MAILHEADER (%)" 8
  1631. XThe format of the header file for replies.
  1632. XSee also MAILPOSTER.
  1633. X.Sp
  1634. XDefault:
  1635. X.Sp
  1636. XTo: %T
  1637. X.br
  1638. XSubject: %(%i=^$?:Re: %S
  1639. X.br
  1640. XNewsgroups: %n
  1641. X.br
  1642. XIn-Reply-To: %i)
  1643. X.br
  1644. X%(%[references]!=^$?References\\: %[references]
  1645. X.br
  1646. X)Organization: %o
  1647. X.br
  1648. XCc: 
  1649. X.br
  1650. XBcc: \en\en
  1651. X.Ip "MAILPOSTER (~)" 8
  1652. XThe shell command to be used by the reply commands (r and R)
  1653. Xin order to allow you to enter and deliver the response.
  1654. X.I trn
  1655. Xwill not itself call upon an editor for replies\*(--this
  1656. Xis a function of the program called by
  1657. X.IR trn .
  1658. XSee also MAILHEADER.
  1659. X.Sp
  1660. XDefault: Rnmail \-h %h
  1661. X.Ip "MBOXSAVER (~)" 8
  1662. XThe shell command to save an article in mailbox format.
  1663. X.Sp
  1664. XDefault: %X/mbox.saver %A %P %c %a %B %C "%b" \e
  1665. X.br
  1666. X"From: %T %`date`"
  1667. X.Sp
  1668. XExplanation: the first seven arguments are the same as for NORMSAVER.
  1669. XThe eighth argument to the shell script is the new From: line
  1670. Xfor the article, including the posting date,
  1671. Xderived either directly from the Posted: line, or not-so-directly from
  1672. Xthe Date: line.
  1673. XHeader munging at its finest.
  1674. X.Ip MODSTRING 8
  1675. XThe string to insert in the group summary line, which heads each article,
  1676. Xfor a moderated group.  See also NOPOSTRING.
  1677. X.Sp
  1678. XDefault: " (moderated)"
  1679. X.Ip NAME 8
  1680. XYour full name.
  1681. XMay be interpolated using \*(L"%N\*(R".
  1682. X.Sp
  1683. XDefault: name from /etc/passwd, or ~/.fullname.
  1684. X.Ip "NEWSHEADER (%)" 8 16v
  1685. XThe format of the header file for followups.
  1686. XSee also NEWSPOSTER.
  1687. X.Sp
  1688. XDefault:
  1689. X.Sp
  1690. XNewsgroups: %(%F=^$?%C:%F)
  1691. X.br
  1692. XSubject: %(%S=^$?%"\en\enSubject: ":Re: %S)
  1693. X.br
  1694. XSummary:
  1695. X.br
  1696. XExpires: 
  1697. X.br
  1698. X%(%R=^$?:References: %R
  1699. X.br
  1700. X)Sender: 
  1701. X.br
  1702. XReply-To: %L@%H (%N)
  1703. X.br
  1704. XFollowup-To: 
  1705. X.br
  1706. XDistribution: %(%i=^$?%"\enDistribution: ":%D)
  1707. X.br
  1708. XOrganization: %o
  1709. X.br
  1710. XKeywords: \en\en
  1711. X.Ip "NEWSPOSTER (~)" 8
  1712. XThe shell command to be used by the followup commands (f and F)
  1713. Xin order to allow you to enter and post a followup news article.
  1714. X.I trn
  1715. Xwill not itself call upon an editor for followups\*(--this
  1716. Xis a function of the program called by
  1717. X.IR trn .
  1718. XSee also NEWSHEADER.
  1719. X.Sp
  1720. XDefault: Pnews \-h %h
  1721. X.Ip NEWSRC 8
  1722. XYour newsgroup subscription list.
  1723. X.Sp
  1724. XDefault: $HOME/.newsrc
  1725. X.Ip NNTPSERVER 8
  1726. XThe hostname of your NNTPSERVER. [This does not apply unless you are running
  1727. Xthe NNTP version of rn.]
  1728. X.Sp
  1729. XDefault: the hostname listed in the server file, usually
  1730. X/usr/local/lib/rn/server.
  1731. X.Ip NOPOSTRING 8
  1732. XThe string to insert in the group summary line, which heads each article,
  1733. Xfor a group to which local posting is not allowed.  See also MODSTRING.
  1734. X.Sp
  1735. XDefault: " (no posting)"
  1736. X.Ip "NORMSAVER (~)" 8
  1737. XThe shell command to save an article in the normal (non-mailbox) format.
  1738. X.Sp
  1739. XDefault: %X/norm.saver %A %P %c %a %B %C "%b"
  1740. X.Ip ORGANIZATION 8
  1741. XEither the name of your organization, or the name of a file containing the
  1742. Xname of your organization.
  1743. XMay be interpolated using \*(L"%o\*(R".
  1744. X.Sp
  1745. XDefault: whatever your news administrator compiled in.
  1746. X.Ip PAGESTOP 8
  1747. XIf defined, contains a regular expression which matches article lines to
  1748. Xbe treated as form-feeds.
  1749. XThere are at least two things you might want to do with this.
  1750. XTo cause page breaks between articles in a digest, you might define it
  1751. Xas \*(L"^--------\*(R".
  1752. XTo force a page break before a signature, you could define it
  1753. Xas \*(L"^-- $\*(R".
  1754. X(Then, when you see \*(L"--\*(R" at the bottom of the page, you can skip
  1755. Xthe signature if you so desire by typing \*(L'n\*(R' instead of space.)
  1756. XTo do both, you could use \*(L"^--\*(R".
  1757. XIf you want to break on more than one pattern, you can use \*(L"\||\|\*(R" to
  1758. Xseparate the alternatives.
  1759. X.Sp
  1760. XThere is some overhead involved in matching each line of the article against
  1761. Xa regular expression.
  1762. XYou might wish to use a baud-rate modifier to enable this feature only at
  1763. Xlow baud rates.
  1764. X.Sp
  1765. XDefault: undefined
  1766. X.Ip "PIPESAVER (%)" 8
  1767. XThe shell command to execute in order to accomplish a save to a pipe
  1768. X(\*(L"s\ |\ command\*(R" or \*(L"w\ |\ command\*(R").
  1769. XThe command typed by the user is substituted in as %b.
  1770. X.Sp
  1771. XDefault: %(%B=^0$?<%A:tail +%Bc %A |) %b
  1772. X.Sp
  1773. XExplanation: if %B is 0, the command is \*(L"<%A %b\*(R", otherwise
  1774. Xthe command is \*(L"tail +%Bc %A | %b\*(R".
  1775. X.Ip RNINIT 8
  1776. XDefault values for switches may be passed to
  1777. X.I trn
  1778. Xby placing them in RNINIT.
  1779. XAny switch that is set in RNINIT may be overruled 
  1780. Xon the command line, or via the \*(L'&\*(R' command from within
  1781. X.IR trn .
  1782. XBinary-valued switches that are set with \*(L"\-switch\*(R" may be unset
  1783. Xusing \*(L"+switch\*(R".
  1784. X.Sp
  1785. XIf RNINIT begins with a \*(L'/\*(R' it is assumed to be the name of a file
  1786. Xcontaining switches.
  1787. XIf you want to set many environment variables but don't want to keep
  1788. Xthem all in your environment, or if the use of any of these variables
  1789. Xconflicts with other programs, you can use this feature along with the
  1790. X.B \-E
  1791. Xswitch to set the environment variables upon startup.
  1792. X.Sp
  1793. XDefault: \*(L" \*(R".
  1794. X.Ip "RNMACRO (~)" 8
  1795. XThe name of the file containing macros and key mappings.
  1796. XSee the MACROS section.
  1797. X.Sp
  1798. XDefault: %./.rnmac
  1799. X.Ip "SAVEDIR (~)" 8
  1800. XThe name of the directory to save to, if the save command does not specify
  1801. Xa directory name.
  1802. X.Sp
  1803. XDefault:
  1804. X.br
  1805. X   If
  1806. X.B \-/
  1807. Xis set: %p/%c
  1808. X.br
  1809. X   If
  1810. X.B +/
  1811. Xis set: %p
  1812. X.Ip "SAVENAME (%)" 8
  1813. XThe name of the file to save to, if the save command contains only a
  1814. Xdirectory name.
  1815. X.Sp
  1816. XDefault:
  1817. X.br
  1818. X   If
  1819. X.B \-/
  1820. Xis set: %a
  1821. X.br
  1822. X   If
  1823. X.B +/
  1824. Xis set: %^C
  1825. X.Ip "SELECTCHARS" 8
  1826. XThe characters used by the thread selector to select the associated thread
  1827. Xof discussion.
  1828. XYou can specify up to 64 visible characters, including upper- and lower-case
  1829. Xletters, numbers, and many punctuation characters.
  1830. XSelection characters override command characters in the selector, but are
  1831. Xnot excluded from macro expansion, so be careful.
  1832. X.br
  1833. XDefault: abcdefgijlorstuvwxz1234567890
  1834. X that can be typed
  1835. X.Ip SHELL 8
  1836. XThe name of your preferred shell.
  1837. XIt will be used by the \*(L'!\*(R', \*(L'S\*(R' and \*(L'W\*(R' commands.
  1838. X.Sp
  1839. XDefault: whatever your news administrator compiled in.
  1840. X.Ip "SUBJLINE (%)" 8
  1841. XControls the format of the lines displayed by the \*(L'=\*(R' command at
  1842. Xthe article selection level.
  1843. X.Sp
  1844. XDefault: %s
  1845. X.Ip TERM 8
  1846. XDetermines which termcap entry to use, unless TERMCAP contains the entry.
  1847. X.Ip TERMCAP 8
  1848. XHolds either the name of your termcap file, or a termcap entry.
  1849. X.Sp
  1850. XDefault: /etc/termcap, normally.
  1851. X.Ip "UNSHAR (~)" 8
  1852. XThe shell command to execute in order to accomplish the unshar'ing of a
  1853. Xshell archive.
  1854. X.Sp
  1855. XDefault: /bin/sh
  1856. X.Ip USER 8
  1857. XYour login name.
  1858. XMay be interpolated using \*(L"%L\*(R".
  1859. X.Sp
  1860. XDefault: $LOGNAME
  1861. X.Ip "VISUAL (~)" 8
  1862. XThe name of your editor.
  1863. X.Sp
  1864. XDefault: $EDITOR
  1865. X.Ip "YOUSAID (%)" 8
  1866. XGives the format of the attribution line in front of the quoted article
  1867. Xincluded by an R command.
  1868. X.Sp
  1869. XDefault: In article %i you write:
  1870. X.SH MACROS
  1871. XWhen
  1872. X.I trn
  1873. Xstarts up, it looks for a file containing macro definitions (see environment
  1874. Xvariable RNMACRO).
  1875. XAny sequence of commands may be bound to any sequence of keys, so you
  1876. Xcould remap your entire keyboard if you desire.
  1877. XBlank lines or lines beginning with # in the macro file are considered
  1878. Xcomments; otherwise
  1879. X.I trn
  1880. Xlooks for two fields separated by white space.
  1881. XThe first field gives the sequence of keystrokes that trigger the macro,
  1882. Xand the second field gives the sequence of commands to execute.
  1883. XBoth fields are subject to % interpolation, which will also translate
  1884. Xbackslash and uparrow sequences.
  1885. X(The keystroke field is interpreted at startup time, but the command field
  1886. Xis interpreted at macro execution time so that you may refer to % values
  1887. Xin a macro.)
  1888. XFor example, if you want to reverse the roles of carriage return and
  1889. Xspace in
  1890. X.I trn
  1891. X.Sp
  1892. X^J    \e040
  1893. X.br
  1894. X^M    \e040
  1895. X.br
  1896. X\e040    ^J
  1897. X.Sp
  1898. Xwill do just that.
  1899. XBy default, all characters in the command field are interpreted as the
  1900. Xcanonical
  1901. X.I trn
  1902. Xcharacters, i.e. no macro expansion is done.
  1903. XOtherwise the above pair of macros would cause an infinite loop.
  1904. XTo force macro expansion in the command field, enclose the
  1905. Xmacro call with ^( ... ^) thusly:
  1906. X.Sp
  1907. X@s    |mysavescript
  1908. X.br
  1909. X@w    w^(@s^)
  1910. X.Sp
  1911. XYou can use the %() conditional construct to construct macros that work
  1912. Xdifferently under different circumstances.
  1913. XIn particular, the current mode (%m) of
  1914. X.I trn
  1915. Xcould be used to make a command that only works at a particular level.
  1916. XThis is particularly vital for the thread selector, which uses most of
  1917. Xthe lower-case letters to select the associated thread of discussion.
  1918. XFor example,
  1919. X.Sp
  1920. Xa    %(%m=t?a:s art.hold\en)
  1921. X.Sp
  1922. Xwill return the original letter (a) in the thread selector, and the command
  1923. X\*(L"s art.hold\en\*(R" everywhere else.
  1924. X.Sp
  1925. X%(%{TERM}=vt100?^[[O)    /^J
  1926. X.Sp
  1927. Xwill do the binding only if the terminal type is vt100,
  1928. Xthough if you have many of these it would be better to have separate
  1929. Xfiles for each terminal.
  1930. X.Sp
  1931. XIf you want to bind a macro to a function key that puts a common garbage character
  1932. Xafter the sequence (such as the carriage return on the end of Televideo 920
  1933. Xfunction sequences), DO NOT put the carriage return
  1934. Xinto all the sequences or you will waste a CONSIDERABLE amount of internal
  1935. Xstorage.
  1936. XInstead of \*(L"^AF^M\*(R", put \*(L"^AF+1\*(R", which indicates to
  1937. X.I trn
  1938. Xthat it should gobble up one character after the F.
  1939. X.SH "WHAT'S NEW?"
  1940. XHere's a quick run-down of
  1941. X.IR trn 's
  1942. Xnew features and commands aimed at the knowledgeable
  1943. X.I rn
  1944. Xuser.
  1945. X.Sp
  1946. XOne of the biggest improvements is the Thread Selector, which is bound
  1947. Xto the \*(L'+\*(R' key.
  1948. XThe selector displays a list of subject threads and (by default) authors
  1949. Xto allow you to select the topics that interest you by typing their
  1950. Xassociated letter.
  1951. XThe thread selector can also be used to browse articles that have already
  1952. Xbeen read, to selectively re-read discussions (use the \*(L'U\*(R' command).
  1953. X.Sp
  1954. XAnother big improvement is the thread-ordered display of articles.
  1955. XWhile reading each topic,
  1956. X.I trn
  1957. Xdisplays each article and its replies in the order of their parent/child
  1958. Xrelationship.
  1959. XThis lets you follow the flow of the discussion better, instead of jumping
  1960. Xaround from idea to idea or even reading a reply before the original article.
  1961. X.Sp
  1962. XAlong this same line is the addition of the article-tree display in the
  1963. Xupper-right corner of the header.
  1964. XGlancing at the tree gives you a better feel for how the articles you are
  1965. Xreading relate to each other.
  1966. X.Sp
  1967. XThe header has also been modified to hide a few more header-lines by default
  1968. X(e.g. References), but, as always, you can override these with \-h.
  1969. XThere is also some new \*(L"magic\*(R" in the header: the From header is
  1970. Xtrimmed to be just the comment portion (if available), and the Date header
  1971. Xis displayed in local time (in threaded groups).
  1972. XOverride these defaults with +H.
  1973. X.Sp
  1974. XOnce you begin reading articles, use the regular movement commands (n, N,
  1975. Xp, P, etc.) as you normally would.
  1976. XThen, check out the [, ], {, and } commands to move around in the article
  1977. Xtree a bit more directly.
  1978. XFor example, the \*(L'[\*(R' command takes you to your parent article,
  1979. Xeven if it was already read, whichp is very useful for tracking down the
  1980. Xcited portion of the article in its original context.
  1981. X.Sp
  1982. XThere are additional kill commands for the entire thread (J) and the
  1983. Xcurrent article and all its replies (,).
  1984. XThe KILL files have been extended to allow killing by thread (T), which will
  1985. Xkill a topic even if people fine-tune the subject along the way.
  1986. X.Sp
  1987. XThere is also an easy way to skip around in the various threads with
  1988. Xthe < and > commands.
  1989. X.Sp
  1990. XThere is a new command, \*(L"e dir\*(R", that extracts a shell archive or
  1991. Xuuencoded file into the specified directory.
  1992. XIt is even possible to extract other data formats if you specify the
  1993. Xappropriate filter command (e.g. \*(L"e dir|cmd\*(R".
  1994. X.Sp
  1995. XAlso, if you plan to use macro definitions, it is good to keep in mind
  1996. Xthat the thread selector uses most of the lower-case letters for thread
  1997. Xselection, and thus it is a good idea to explicitly set the mode(s) in
  1998. Xwhich a macro applies.
  1999. XFor example, if you want to press 'f' from the article pager/selector to
  2000. Xforward the current article to the user \*(L"smith\*(R", you could define:
  2001. X.Sp
  2002. X.nf
  2003. X    f    %(%m=[pa]?|mail smith\en:f)
  2004. X.fi
  2005. X.Sp
  2006. XThis checks the current mode (%m) and if it is \*(L'p\*(R' or \*(L'a\*(R'
  2007. Xit expands it to the string \*(L"|mail smith\en\*(R", otherwise it returns
  2008. Xthe letter \*(L'f\*(R'.
  2009. XIn some cases, you may simply wish to exclude the thread selector from a
  2010. Xmacro with the conditional \*(L"%m!=t\*(R".
  2011. X.Sp
  2012. XFinally, you'll probably want to use the new options,
  2013. X.B \-x
  2014. Xand
  2015. X.B \-X
  2016. Xto ensure that all the newest features are available for use.
  2017. XThese options might be on by default, depending on how your administrator
  2018. Xdecided to install
  2019. X.IR trn .
  2020. X.SH AUTHORS
  2021. XRn was created by Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
  2022. X.br
  2023. Xand is now under the direction of Stan Barber <sob@bcm.tmc.edu>.
  2024. X.br
  2025. XThreaded version by Wayne Davison <davison@borland.com>
  2026. X.br
  2027. X(Mail all bug reports for trn to Wayne.)
  2028. X.br
  2029. XRegular expression routines are borrowed from emacs, by James Gosling.
  2030. X.SH FILES
  2031. X.Ip "%./.newsrc" 1.25i
  2032. Xstatus of your news reading
  2033. X.Ip "%./.oldnewsrc" 1.25i
  2034. Xbackup copy of your
  2035. X.I .newsrc
  2036. Xfrom start of session
  2037. X.Ip "%./.rnlock" 1.25i
  2038. Xlock file so you don't screw up your
  2039. X.I .newsrc
  2040. X.Ip "%./.rnlast" 1.25i
  2041. Xinfo from last run of rn
  2042. X.Ip "%./.rnsoft" 1.25i
  2043. Xsoft pointers into /usr/lib/news/active to speed startup, synchronous with
  2044. X.I .newsrc
  2045. X.Ip "%./.rnhead" 1.25i
  2046. Xtemporary header file to pass to a mailer or news poster
  2047. X.Ip "%./.rnmac" 1.25i
  2048. Xmacro and keymap definitions
  2049. X.Ip "%p" 1.25i
  2050. Xyour news save directory, usually ~/News
  2051. X.Ip "%x/active" 1.25i
  2052. Xthe list of active newsgroups, usually /usr/lib/news/active on systems that don't use NNTP
  2053. X.Ip "%X/active2" 1.25i
  2054. Xthe list of active newsgroups when running in threaded mode.
  2055. X.Ip "%P" 1.25i
  2056. Xthe public news spool directory, usually /usr/spool/news on systems that don't use NNTP
  2057. X.Ip "%X/INIT" 1.25i
  2058. Xsystem-wide default switches
  2059. X.SH SEE ALSO
  2060. Xnewsrc(5), more(1), readnews(1), Pnews(1), Rnmail(1)
  2061. X.SH DIAGNOSTICS
  2062. XGenerally self-documenting, as they say.
  2063. X.SH BUGS
  2064. XThe
  2065. X.B \-h
  2066. Xswitch can only hide header lines that
  2067. X.I trn
  2068. Xknows about.
  2069. X.PP
  2070. XThe \*(L'\-\*(R' command doesn't cross newsgroup boundaries, and only undoes
  2071. Xthe last article selection.
  2072. X.PP
  2073. XIf you edit your
  2074. X.I .newsrc
  2075. Xwhile
  2076. X.I trn
  2077. Xis running,
  2078. X.I trn
  2079. Xwill happily wipe out your changes when it decides to
  2080. Xwrite out the
  2081. X.I .newsrc
  2082. Xfile.
  2083. X.PP
  2084. XMarking of duplicate articles as read in cross-referenced newsgroups will
  2085. Xnot work unless the Xref patch is installed in inews.
  2086. X.PP
  2087. XIf you get carried away with % or escape substitutions, you can overflow
  2088. Xbuffers.
  2089. X.PP
  2090. XThere should be no fixed limit on the number of newsgroups.
  2091. X.PP
  2092. XSome of the more esoteric features may be missing on machines with limited
  2093. Xaddress space.
  2094. END_OF_FILE
  2095.   if test 42762 -ne `wc -c <'trn.1.2'`; then
  2096.     echo shar: \"'trn.1.2'\" unpacked with wrong size!
  2097.   fi
  2098.   # end of 'trn.1.2'
  2099. fi
  2100. echo shar: End of archive 2 \(of 14\).
  2101. cp /dev/null ark2isdone
  2102. MISSING=""
  2103. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  2104.     if test ! -f ark${I}isdone ; then
  2105.     MISSING="${MISSING} ${I}"
  2106.     fi
  2107. done
  2108. if test "${MISSING}" = "" ; then
  2109.     echo You have unpacked all 14 archives.
  2110.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2111. else
  2112.     echo You still must unpack the following archives:
  2113.     echo "        " ${MISSING}
  2114. fi
  2115. exit 0
  2116.